<template>
  <div>
    首页
    <!--
      .sync:作用：值的双向绑定
         <子组件标签  :属性名="父组件属性" @update:属性名="父组件属性=$event" />
         <子组件标签  :属性名.sync="父组件属性"  />
         子组件内:
           props:['属性名']
           this.$emit('update:属性名',实参值) -->
    <hr>
    <h2>{{ fatherNum }}</h2>
    <!-- <SyncSon :num="fatherNum" @update:num="fatherNum = $event" /> -->
    <SyncSon :num.sync="fatherNum" />
  </div>
</template>
<script>
import SyncSon from './components/SyncSon.vue'
export default {
  components: {
    SyncSon
  },
  data() {
    return {
      fatherNum: 0
    }
  }
}
</script>
<style></style>
